package cn.com.hfuu.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.hfuu.dao.menuMapper;
import cn.com.hfuu.module.menu;
import cn.com.hfuu.module.role;

@Service("menuservice")
public class MenuService {
	
	@Autowired
	menuMapper menumap;
	
	/**
	 * 获取一级菜单
	 * @return
	 */
	public List<menu> selectAll(){
		return menumap.selectAll();
	}

	public List<menu> selectbymenuparentid(String[] ids) {
		
		// TODO Auto-generated method stub
		return menumap.selectFirstby(ids);
	}

	public List<menu> selectids(String[] ids) {
		// TODO Auto-generated method stub
		return menumap.selectids(ids);
	}

	public List<menu> selectpage(Integer start, Integer limit) {
		// TODO Auto-generated method stub
		return menumap.selectpage(start,limit);
	}

	public List<menu> selectpagetotal() {
		// TODO Auto-generated method stub
		return menumap.selectpagetotal();
	}
	
	public List<menu> selectfiirsttotal(String parentid) {
		// TODO Auto-generated method stub
		return menumap.selectfiirsttotal(parentid);
	}

	public int insert(menu m) {
		// TODO Auto-generated method stub
		return menumap.insertSelective(m);
	}

	public menu selectbyid(String id) {
		// TODO Auto-generated method stub
		return menumap.selectByPrimaryKey(id);
	}

	public int update(menu m) {
		return menumap.updateByPrimaryKeySelective(m);
		// TODO Auto-generated method stub
		
	}

	public int delete(String id) {
		// TODO Auto-generated method stub
		return menumap.deleteByPrimaryKey(id);
	}

	public cn.com.hfuu.module.menu selectabyid(String id) {
		// TODO Auto-generated method stub
		return menumap.selectaByPrimaryKey(id);
	}

	 
}
